import Mock from 'mockjs'

const courseSimpleList = Mock.mock({
    'items': [{
        id: '@id',
        title: '@sentence(5, 10)',
        author: '@name',
        cover: '@image',
        viewCounts: '@integer(1, 1000000)',
        score: '@integer(0, 10)',
        courseDuration: Mock.Random.time('HH:mm:ss')
    }]
})

Mock.mock('/mock/course/simple/list', 'POST', () => {
    const items = courseSimpleList.items;
    return {
        code: 20000,
        data: {
            total: items.length,
            items: items
        }
    }
})
